<template>
    <view class="content columnbox">
        <view class="info-title">{{info.name}}
            <text>{{info.addtime}}</text>
        </view>
        <rich-text :nodes="info.content" class="info-box"></rich-text>
    </view>
</template>

<script>
    import getDate from '@/utils/time.js'
    export default {
        data() {
            return {
                id: 0,
                info: ''
            };
        },
        onLoad(options) {
            this.id = options.id * 1
            this.getDetail()
        },
        methods: {
            getDetail() {
                this.$req.post('/admin/knowledgeinfo', {
                    id: this.id
                }).then(res => {
                    this.info = res.data.data
                    this.info.addtime = getDate.couponDate(res.data.data.addtime)
                })
            }
        }
    }
</script>

<style lang="scss" scoped>
    .info-title {
        width: 90%;
        font-size: 32rpx;
        padding-bottom: 20rpx;
        border-bottom: #e2e2e2 solid 1px;
        margin-bottom: 20rpx;

        text {
            font-size: 24rpx;
            margin-left: 20rpx;
            color: #afafaf;
        }
    }

    .info-box {
        font-size: 28rpx;
        width: 90%;
    }
</style>